function getFileExtension(filename)
{
   
  // alert(' file name ' +filename);
    filename = trim(filename);
    
    var ext = /^.+\.([^.]+)$/.exec(filename);
  return ext == null ? "" : ext[1].toLowerCase();
}



function getFileName(filename) {
    if (filename.indexOf('/') > -1)
        answer = filename.substring(filename.lastIndexOf('/')+1,filename.length);
    else
        answer = filename.substring(filename.lastIndexOf('\\')+1,filename.length);
    
        //alert(answer);
    return answer;
}



